﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;


namespace AirHockey
{
    public class GameTimer
    {
        #region Members
        private GameTime gameTime;
        private static GameTimer instance;
        private Stopwatch timer;
        #endregion

        #region Properties
        public static GameTimer Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new GameTimer();
                }

                return instance;
            }
        }

        public GameTime GameTime
        {
            get
            {
                gameTime.UpdateElapsedGameTime(timer.ElapsedMilliseconds);
                return gameTime;
            }
        }
        #endregion

        #region Constructor
        private GameTimer()
        {
            gameTime = new GameTime();
            timer = new Stopwatch();
            timer.Start();
        }
        #endregion
    }
}
